-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SM64] Smarter and standardized includes #449
Open
Lilaa3
wants to merge
12
commits into
Fast-64:main
Choose a base branch
from
Lilaa3:smart-include-function
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Added new functions, write_includes and update_actor_includes. write_includes is a smarter version of writeIfNotFound specifically for includes and externs, it removes comments prior to searching (but doesn't remove comments from the actual file of course) and allows whitespace (where possible, a path including whitespace won´t be found when searching for a file with no whitespace), futhermore it adds a trailing newline to the file instead of adding a leading newline for each include, the logic that finds the `#endif` of .h files is also improved like the logic to find includes and externs (whitespace is tolerated, comments are ignored) but it also allows no endif for files that use the GCC `#pragma once` macro update_actor_includes standardizes group and level includes into one place for ease of editing, one of the major differences is that level exports no longer use the full path (levels/actor/my_file.c would instead be /actor/my_file.c) this should allow level header type actors to actually update headers on custom non decomp levels but that is not done here
While I like my current idea, I think I can iron out some stuff and actually update writeIfNotFound, looking into that right now |
Lilaa3
changed the title
[SM64] Smarter includes
[SM64] Smarter and standardized includes
Sep 27, 2024
Lilaa3
force-pushed
the
smart-include-function
branch
2 times, most recently
from
September 27, 2024 19:05
bb78cad
to
82f7e22
Compare
Lilaa3
force-pushed
the
smart-include-function
branch
from
September 27, 2024 20:03
df8b312
to
2d76dce
Compare
I'm actually done this time, just needed to change stuff for animations rework |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'd really like some opinions on write_or_delete_if_found's complexity.
Added new functions, write_or_delete_if_found, write_includes and update_actor_includes. Remove writeIfNotFound and deleteIfFound
write_or_delete_if_found is a smarter version of writeIfNotFound and deleteIfFound, it optionally removes comments prior to searching (but doesn't remove comments from the actual file of course) and lets you pass in regex patterns (without worrying about comments!) which allows much smarter searchs that can tolerate whitespace, it adds a trailing newline to the file instead of each include having to include a newline (broke stuff before), the footer can now be optional (allows no endif which is great for files that use the GCC
#pragma once
macro)update_actor_includes standardizes group and level includes into one place for ease of editing, one of the major differences is that level exports no longer use the full path (levels/actor/my_file.c would instead be /actor/my_file.c) this should allow level header type actors to actually update headers on custom non decomp levels but that is not done in this PR (existing includes are unaffected!).
Benifts from this pr: